import { Injectable } from '@nestjs/common';
import { ResponseUtil } from '../common/utils/response.util';

@Injectable()
export class ClusterService {
    
  public namespacesData = {
    "errors": [],
    "listMeta": {
      "totalItems": 3
    },
    "namespaces": [
      {
        "objectMeta": {
          "creationTimestamp": "2023-10-27T08:00:00Z",
          "labels": {
            "kubernetes.io/metadata.name": "default"
          },
          "name": "default",
          "uid": "a1b2c3d4-e5f6-4a5b-8c9d-0123456789ab"
        },
        "phase": "Active",
        "skipAutoPropagation": false,
        "typeMeta": {
          "kind": "Namespace"
        }
      },
      {
        "objectMeta": {
          "creationTimestamp": "2023-10-27T08:00:05Z",
          "labels": {
            "kubernetes.io/metadata.name": "kube-system",
            "karmada.io/system-namespace": "true"
          },
          "name": "kube-system",
          "uid": "b2c3d4e5-f6a7-4b8c-9d0e-1234567890bc"
        },
        "phase": "Active",
        "skipAutoPropagation": true,
        "typeMeta": {
          "kind": "Namespace"
        }
      },
      {
        "objectMeta": {
          "creationTimestamp": "2024-03-15T14:30:00Z",
          "labels": {
            "env": "development",
            "project": "satellite-control"
          },
          "name": "dev-environment",
          "uid": "c3d4e5f6-a7b8-4c9d-0e1f-2345678901cd"
        },
        "phase": "Active",
        "skipAutoPropagation": false,
        "typeMeta": {
          "kind": "Namespace"
        }
      }
    ]
  }
  async getNamespaces(agentId: string) {
    return ResponseUtil.success(this.namespacesData, '获取Namespace列表成功');
  }
}
